<template>
	<view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";

  function isNotEmpty(obj: any) {
    if (typeof obj == undefined || obj == null || obj == "" || obj == "undefined" || obj.length == 0) {
      return false;
    } else {
      return true;
    }
  }
  function setTitle(title: string) {
    uni.setNavigationBarTitle({
      title: title
    })
  }
  // onLoad
  const url = ref("");
  onLoad((val: any) =>{
    console.log(val);
    url.value = decodeURIComponent(val.url)
    if (isNotEmpty(val.title)) {
      setTitle(val.title);
    }
  })
</script>

<style>
</style>
